﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using NQueries.Data.Queries;
using TestModel;

namespace TestConsole
{
    public class QueryAllProductsWithSpec : Query<IAdventureWorksEntities, IEnumerable<Product>>
    {
        protected override Expression<Func<IAdventureWorksEntities, IEnumerable<Product>>> Expression
        {
            get
            {
                return (context) => context.Products.OfType<Product>().Where(new ProductNameContainsSpecification().Predicate).OrderBy(x => x.Name);
            }
        }
    }
}